<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="/css/common/bootstrap.min.css">
    <script src="/js/common/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
        $(function () {
            setInterval(getTime,1000);
        });

        function getTime() {
            var date = new Date();
            var year = date.getFullYear();
            var months = date.getMonth()+1;
            var day = date.getDate();

            var am_pm = "上午";
            var hours = date.getHours();
            if(hours > 12 ){
                am_pm = "下午";
                hours = hours - 12;
            }
            hours = addZero(hours);
            var minutes = date.getMinutes();
            var seconds = date.getSeconds();
            var weekName = getWeekName(date.getDay());

            $("#showTime").text(year+"/"+months+"/"+day+" "+am_pm+" "+hours+":"+minutes+":"+seconds+" "+weekName);
        }

        function addZero(num) {
            if(num < 10){
                num = "0" + num;
            }
            return num;
        }

        function getWeekName(num){
            var res = "";
            switch (num) {
                case 0: res="星期日";break;
                case 1: res="星期一";break;
                case 2: res="星期二";break;
                case 3: res="星期三";break;
                case 4: res="星期四";break;
                case 5: res="星期五";break;
                case 6: res="星期六";
            }
            return res;
        }
    </script>
</head>
<body>
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target="#navbar" >
                <span class="icon-bar"></span> <span class="icon-bar"></span> <span
                    class="icon-bar"></span>
            </button>
            <a class="navbar-brand">ZffcBoot后台管理系统</a>
        </div>
        <div>
            <ul class="nav navbar-nav ">
                <li style="height: 50px; line-height: 50px; color: green;font-weight: bold">当前时间：</li>
                <li id="showTime" style="height: 50px; line-height: 50px; color: black;font-weight: bolder"></li>
            </ul>
        </div>
    </div>
    <div>
        <h2>欢迎进入ZffcBoot后台管理系统</h2>
    </div>
</body>
</html>
